package com.qdlc.p2p.quartz.job;

import java.util.List;

import javax.annotation.Resource;

import com.qdlc.p2p.biz.service.BorrowRepaymentService;
import com.qdlc.p2p.common.util.CollectionUtils;
import com.qdlc.p2p.dal.dto.BorrowRepayment;
import com.qdlc.p2p.quartz.AbstractJob;

/**
 * 逾期产生利息
 *
 * @author wuaj
 * @version 1.1.0.0
 * @since 2016年03月11日
 */
public class DoLate extends AbstractJob {

    @Resource
    private BorrowRepaymentService borrowRepaymentService;

    @Override
    protected void process() {
        List<BorrowRepayment> borrowRepaymentList = borrowRepaymentService.findWaitRepay();
        if (CollectionUtils.isNotNullOrEmpty(borrowRepaymentList)) {
            for (BorrowRepayment borrowRepayment : borrowRepaymentList) {
                borrowRepaymentService.updateLateInterest(borrowRepayment);
            }
        }
    }
}